using Godot;
using System;
using CSharpLearning.flappy_bird.level;

public partial class NumObject : Node
{
    /// <summary>
    /// 数字对象的值
    /// </summary>
    private int _value;
    
    public int Value => _value;

    public void Expression(GameExpression expression)
    {
        switch (expression.Operator)
        {
            case Operator.Add:
                _value += expression.Operand;
                break;
            case Operator.Sub:
                _value -= expression.Operand;
                break;
            case Operator.Mul:
                _value *= expression.Operand;
                break;
            case Operator.Div:
                _value /= expression.Operand;
                break;
        }
    }
}
